<?
/*-- Project Introduce --*/


JCAT_Package::ImportClass('JCAT_UIGtkCtrlTree',JCAT::PACKAGE_UICTRLGTK) ;


/**
 *
 * @author		alee
 * @access		public
 */
class TreeDataVerifierSetting extends JCAT_UIGtkCtrlTree
{

	
	/**
	 * what's this
	 * 
	 * @access	public
	 * @return	array
	 */
	public function TreeDataVerifierSetting()
	{
		$this->JCAT_UIGtkCtrlTree('TreeDataVerifierSetting',JCAT_Language::Sentence('数据校验器设定'),'TreeDataVerifierSetting') ;
	}
	

	public function CreateModel()
	{
		return new GtkTreeStore(Gtk::TYPE_BOOLEAN, Gtk::TYPE_STRING, Gtk::TYPE_STRING, Gtk::TYPE_LONG) ;
	}
	
	/**
	 * 初始化  GtkTreeView
	 * 
	 * @access	public
	 * @return	void
	 */
	public function InitializeColumns()
	{
		// 取得视图
		$wndTreeView = $this->GetMainWidget() ;
		JCAT_ASSERT::ASSERT_INSTANCE($wndTreeView,'GtkTreeView',
					JCAT_Language::SentenceEx('UI控件“%”的主窗体尚未创建，在正常情况下  InitializeColumns()不应该被直接调用，UI控件的主窗体在创建之时，会自动调用此方法。','JCAT',null,$this->GetName())) ;
		
		// 设置列
		$aRenderer = new GtkCellRendererToggle() ;
		$aRenderer->set_property('activatable',true) ;
		$aRenderer->connect('toggled',array($this,'OnActiveToggled'),self::CLM_ENABLE) ;
		$aColumn = new GtkTreeViewColumn(JCAT_Language::Sentence('可用'),$aRenderer,'active',self::CLM_ENABLE) ;
		$wndTreeView->append_column($aColumn) ;
		
		$aRenderer = new GtkCellRendererText() ;
		$aColumn = new GtkTreeViewColumn(JCAT_Language::Sentence('类型'),$aRenderer,'text',self::CLM_KIND) ;
		$wndTreeView->append_column($aColumn) ;
		
		$aRenderer = new GtkCellRendererText() ;
		$aColumn = new GtkTreeViewColumn(JCAT_Language::Sentence('规则'),$aRenderer,'text',self::CLM_RULE) ;
		$wndTreeView->append_column($aColumn) ;
		
	}


	const CLM_ENABLE = 0 ;
	const CLM_KIND = 1 ;
	const CLM_RULE = 2 ;
	const CLM_DOCID = 3 ;

	// 属性 ///////////////////////////////////////////////////////////////////////////////


}

?>